<%--
  Created by IntelliJ IDEA.
  User: w1057229265
  Date: 2021/6/21
  Time: 21:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../static/plugins/jquery-easyui-1.9.15/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../static/plugins/jquery-easyui-1.9.15/themes/icon.css">
    <script type="text/javascript" src="../static/plugins/jquery-easyui-1.9.15/jquery.min.js"></script>
    <script type="text/javascript" src="../static/plugins/jquery-easyui-1.9.15/jquery.easyui.min.js"></script>
    <script>
        $(function (){
            $('#dd').dialog({
                title: '添加订单',
                width: 400,
                height: 300,
                closed: false,
                cache: false,
                modal: true,
                buttons:[{
                    text:'保存',
                    iconCls:'icon-save',
                    handler:function (){
                        $.messager.progress();	// display the progress bar
                        $('#ff').form('submit', {
                            url: '/ServletOrder?action=reg1',
                            onSubmit: function(){
                                var isValid = $(this).form('validate');
                                if (!isValid){
                                    $.messager.progress('close');	// hide progress bar while the form is invalid
                                }
                                return isValid;	// return false will stop the form submission
                            },
                            success: function(data){
                                var data = eval('(' + data + ')'); // change the JSON string to javascript object
                                if (data.code == '200'){
                                    $.messager.alert('提示',data.msg + '请继续操作', 'info')
                                        location.href="book1.jsp"
                                }
                                else {
                                    $.messager.alert('提示',data.msg , 'warning')
                                }
                                $.messager.progress('close');	// hide progress bar while submit successfully
                            }
                        });
                    }
                },
                    {
                        text: '退出',
                        iconCls:'icon-back',
                        handler:function (){
                            location.href='/head.jsp';
                        }
                    }]
            });
        })
    </script>
</head>
<body>
<div id="dd">
<form id="ff" method="post">
    <table cellpadding="5">
        <tr>
            <td>ID:</td>
            <td><input class="easyui-textbox" type="text" name="id" id="id" data-options="required:true"></input></td>
        </tr>
        <tr>
            <td>书名:</td>
            <td><input class="easyui-textbox" type="text" name="bookcase" id="bookcase" data-options="required:true"></input></td>
        </tr>

        <tr>
            <td>Message:</td>
            <td><input class="easyui-textbox" name="message" id="message" data-options="required:true" style="height:60px"></input></td>
        </tr>
    </table>
</form>
</div>
</body>
</html>
